import request from '@/utils/request'
import qs from 'qs'

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/parse',
    method: 'get',
    params: { token }
  })
}
// 获取图形验证码
export function getCaptcha(params) {
  return request({
    url: '/captcha',
    method: 'get',
    params
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'GET'
  })
}

// 示例：传递formData
export function formDataDemo(data) {
  return request({
    url: '/demo/demo/demo',
    method: 'post',
    data: qs.stringify(data),
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
